<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>默认值</div>
    <script>
        var bigObj = {};
        var obj = (function fn(){
           var val = ''; 
           return  Object.defineProperties(bigObj,{
                name:{
                    get(){
                        
                        return val || 'abc';
                    },
                    set(v){

                        document.querySelector('div').innerHTML = v;
                        val = v;
                    }
                }
            })
        })();

        obj.name = '老王'

    </script>
</body>
</html>